package cn.jh.common.pay.utils;

import cn.jh.common.pay.interfaces.RetCode;

import java.io.Serializable;


/**
 * @author EDZ
 * @since 1.0
 */
public class ImmutableRetCode implements RetCode, Serializable {

    static ImmutableRetCode of(String code, String message) {
        return new ImmutableRetCode(code, message);
    }

    private final String code;
    private final String message;

    private ImmutableRetCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return String.format("RetCode(%s, %s)", code, message);
    }
}
